package com.ysqcould.content.service.impl;


import com.ysqcould.common.utils.DateUtils;
import com.ysqcould.content.domain.PressReproduce;
import com.ysqcould.content.domain.vo.PressReproduceVo;
import com.ysqcould.content.mapper.PressReproduceMapper;
import com.ysqcould.content.service.IPressReproduceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章转载记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-29
 */
@Service
public class PressReproduceServiceImpl implements IPressReproduceService
{
    @Autowired
    private PressReproduceMapper pressReproduceMapper;

    /**
     * 查询文章转载记录
     * 
     * @param id 文章转载记录主键
     * @return 文章转载记录
     */
    @Override
    public PressReproduce selectPressReproduceById(Long id)
    {
        return pressReproduceMapper.selectPressReproduceById(id);
    }

    /**
     * 查询文章转载记录列表
     * 
     * @param pressReproduce 文章转载记录
     * @return 文章转载记录
     */
    @Override
    public List<PressReproduceVo> selectPressReproduceList(PressReproduce pressReproduce)
    {
        return pressReproduceMapper.selectPressReproduceList(pressReproduce);
    }

    /**
     * 新增文章转载记录
     * 
     * @param pressReproduce 文章转载记录
     * @return 结果
     */
    @Override
    public int insertPressReproduce(PressReproduce pressReproduce)
    {
        pressReproduce.setCreateTime(DateUtils.getNowDate());
        return pressReproduceMapper.insertPressReproduce(pressReproduce);
    }

    /**
     * 修改文章转载记录
     * 
     * @param pressReproduce 文章转载记录
     * @return 结果
     */
    @Override
    public int updatePressReproduce(PressReproduce pressReproduce)
    {
        pressReproduce.setUpdateTime(DateUtils.getNowDate());
        return pressReproduceMapper.updatePressReproduce(pressReproduce);
    }

    /**
     * 批量删除文章转载记录
     * 
     * @param ids 需要删除的文章转载记录主键
     * @return 结果
     */
    @Override
    public int deletePressReproduceByIds(Long[] ids)
    {
        return pressReproduceMapper.deletePressReproduceByIds(ids);
    }

    /**
     * 删除文章转载记录信息
     * 
     * @param id 文章转载记录主键
     * @return 结果
     */
    @Override
    public int deletePressReproduceById(Long id)
    {
        return pressReproduceMapper.deletePressReproduceById(id);
    }
}
